<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateVotePostsTable extends Migration {

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		Schema::create('vote_posts', function(Blueprint $table)
		{
			$table->increments('id');
      $table->string('ip', 16);                    // 投票人的ip

      $table->unsignedInteger('user_id');          // 投票人id
      $table->unsignedInteger('vote_id');  // 投票项id
			$table->nullableTimestamps();
		});
	}

	/**
	 * Reverse the migrations.
	 *
	 * @return void
	 */
	public function down()
	{
		Schema::dropIfExists('vote_posts');
	}

}
